!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("rb_wixui.thunderbolt[TextMarquee]",["react"],t):"object"==typeof exports?exports["rb_wixui.thunderbolt[TextMarquee]"]=t(require("react")):e["rb_wixui.thunderbolt[TextMarquee]"]=t(e.React)}("undefined"!=typeof self?self:this,(function(e){return function(){var t={5329:function(t){"use strict";t.exports=e},448:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t.keyCode===e&&(t.preventDefault(),t.stopPropagation(),t.currentTarget.click())}}const d=c(32),p=c(s),m=e=>{p(e),d(e)},f=(c(u),e=>Object.entries(e).reduce(((e,[t,a])=>(t.includes("data-")&&(e[t]=a),e)),{}));const v={root:"linkElement"},g=(e,r)=>{const{href:n,role:i,target:o,rel:l,className:s="",children:u,linkPopupId:c,anchorDataId:g,anchorCompId:b,tabIndex:h,dataTestId:y=v.root,title:x,onClick:E,onDoubleClick:C,onMouseEnter:M,onMouseLeave:w,onFocus:L,onFocusCapture:S,onBlurCapture:k,"aria-live":I,"aria-disabled":N,"aria-label":q,"aria-labelledby":P,"aria-pressed":O,"aria-expanded":A,"aria-describedby":T,"aria-haspopup":_,"aria-current":j,dataPreview:D,dataPart:B}=e,F=void 0!==e.activateByKey?e.activateByKey:(e=>e?"SpaceOrEnter":"Space")(c);let R;switch(F){case"Enter":R=p;break;case"Space":R=d;break;case"SpaceOrEnter":R=m;break;default:R=void 0}return void 0!==n||c?a.createElement("a",t()({},f(e),{"data-testid":y,"data-popupid":c,"data-anchor":g,"data-anchor-comp-id":b,"data-preview":D,"data-part":B,href:n||void 0,target:o,role:c?"button":i,rel:l,className:s,onKeyDown:R,"aria-live":I,"aria-disabled":N,"aria-label":q,"aria-labelledby":P,"aria-pressed":O,"aria-expanded":A,"aria-haspopup":_,"aria-describedby":T,"aria-current":j,title:x,onClick:E,onMouseEnter:M,onMouseLeave:w,onDoubleClick:C,onFocus:L,onFocusCapture:S,onBlurCapture:k,ref:r,tabIndex:c?0:h}),u):a.createElement("div",t()({},f(e),{"data-testid":y,"data-preview":D,"data-part":B,className:s,tabIndex:h,"aria-label":q,"aria-labelledby":P,"aria-haspopup":_,"aria-disabled":N,"aria-expanded":A,title:x,role:i,onClick:E,onDoubleClick:C,onMouseEnter:M,onMouseLeave:w,ref:r}),u)};var b=a.forwardRef(g);const h="wixui-",y=(e,...t)=>{const a=[];return e&&a.push(`${h}${e}`),t.forEach((e=>{e&&(a.push(`${h}${e}`),a.push(e))})),a.join(" ")};var x={root:"text-marquee",text:"text-marquee__text"},E="JA80dz",C="LZUzlM",M="hMq4aN",w="E4e8xh",L="Otzv5f",S="ACdreM",k="XkxyTV",I="lxWnDa",N="IM2bJh",q="GvLR4M",P="WGSppx",O="pVF6AJ",A="gShssj";const T="marquee-item-text",_="marquee-item-separator",j="marquee-unit",D="heading-tag",B=({size:e,...t})=>a.createElement("svg",{viewBox:"0 0 18 18",fill:"currentColor",width:e||"18",height:e||"18",...t},a.createElement("path",{d:"M7.5,5 C8.32842712,5 9,5.67157288 9,6.5 L9,11.5 C9,12.3284271 8.32842712,13 7.5,13 C6.67157288,13 6,12.3284271 6,11.5 L6,6.5 C6,5.67157288 6.67157288,5 7.5,5 Z M11.5,5 C12.3284271,5 13,5.67157288 13,6.5 L13,11.5 C13,12.3284271 12.3284271,13 11.5,13 C10.6715729,13 10,12.3284271 10,11.5 L10,6.5 C10,5.67157288 10.6715729,5 11.5,5 Z M7.5,6 C7.22385763,6 7,6.22385763 7,6.5 L7,11.5 C7,11.7761424 7.22385763,12 7.5,12 C7.77614237,12 8,11.7761424 8,11.5 L8,6.5 C8,6.22385763 7.77614237,6 7.5,6 Z M11.5,6 C11.2238576,6 11,6.22385763 11,6.5 L11,11.5 C11,11.7761424 11.2238576,12 11.5,12 C11.7761424,12 12,11.7761424 12,11.5 L12,6.5 C12,6.22385763 11.7761424,6 11.5,6 Z"}));B.displayName="PauseSmall";var F=B;const R=({size:e,...t})=>a.createElement("svg",{viewBox:"0 0 18 18",fill:"currentColor",width:e||"18",height:e||"18",...t},a.createElement("path",{d:"M6.87468837,5.45041947 L12.7318793,8.46657119 C13.20163,8.68731241 13.20163,9.26940918 12.7318793,9.53342881 L6.87468837,12.5495805 C6.58008377,12.7012867 6.00070071,12.5801226 6,12.0161517 L6,5.98384828 C6,5.65247743 6.35266876,5.20682168 6.87468837,5.45041947 Z M7,11.3602529 L11.5834735,9 L7,6.63974714 L7,11.3602529 Z"}));R.displayName="PlaySmall";var Z=R;const W=e=>{let{isPlaying:t,onToggle:a,translations:r,className:n}=e;return i().createElement("button",{className:n,onKeyDown:e=>{"Space"===e.code&&(a(),e.preventDefault())},"aria-label":r.ariaLabel,"aria-pressed":t},t?i().createElement(F,null):i().createElement(Z,null))},z=e=>{let{svgId:t}=e;return i().createElement("svg",{className:"ar-"+t.replaceAll(".","-")},i().createElement("use",{href:"#"+t,width:"100%",height:"100%"}))},K=e=>{const{singleTextItem:a,svgString:r="",index:n,isOriginal:o,isDecorative:s,svgId:u,allowColorOverride:c,setWidth:d,width:p,styleProperties:m,movementDirection:f}=e,v=i().useRef(null),g=o&&0===n&&(!s||a.resolvedLink);i().useEffect((()=>{0===n&&o&&window.requestAnimationFrame((()=>{var e;const t=null==(e=v.current)?void 0:e.offsetWidth;t!==p&&d(t)}))}),[null==m?void 0:m.font,n,o,d,p,a.text,f]);const b=a.text.replaceAll("\n","");return i().createElement("span",{className:l(I,E),ref:v,"data-testid":j},i().createElement("span",t()({className:l(N,P,y(x.text)),"data-testid":T},g?{}:{"data-text":b,"aria-hidden":"true"}),g?i().createElement("span",null,b):""),u&&"none"!==u&&i().createElement($,{svgId:u,svgString:r,className:l(N,c?q:"")}))},$=e=>{let{svgId:a,svgString:r,className:n}=e;const o={className:n,"data-testid":_};return r?i().createElement("span",t()({},o,{dangerouslySetInnerHTML:{__html:r}})):i().createElement("span",o,i().createElement(z,{svgId:a}))},J=e=>{const{multiplicationFactor:a,isOriginal:r,dataMarqueeAnimation:n}=e;return i().createElement("span",{className:l(w,E),"data-marquee-animation":n},Array(a).fill(0).map(((a,n)=>i().createElement(K,t()({},e,{index:n,key:r+"-"+n})))))},V=e=>{const{pauseOnHover:r,singleTextItem:n,isInEditor:o,setAnimationState:s,animationApplied:u}=e,c=r||(null==n?void 0:n.resolvedLink),d=(0,a.useRef)(null);return(0,a.useEffect)((()=>{if(null!=d&&d.current&&u){var e,t;const a=null==(e=window.getComputedStyle(null==(t=d.current)?void 0:t.firstChild))?void 0:e.getPropertyValue("animation-play-state");s(a)}}),[o,s,u]),i().createElement("span",{ref:d,className:l(C,E,c&&k)},i().createElement(J,t()({},e,{isOriginal:!0})),i().createElement(J,e))};const G={TextMarquee:{component:e=>{const{id:r,singleTextItem:n,isInEditor:o=!1,headingLevel:s,tagName:u,styleProperties:c,speed:d,movementDirection:p,translations:m,customClassNames:f=[]}=e,[v,g]=(0,a.useState)(20),[h,E]=(0,a.useState)(null),[C,w]=(0,a.useState)(null),[k,I]=(0,a.useState)(""),N=(0,a.useRef)(null),q=(0,a.useRef)(0),[P,T]=(0,a.useState)(!1);(0,a.useEffect)((()=>{if(h&&q.current){var e;const t=(v*h+v*parseInt(null==c?void 0:c.spaceBetweenItems,10))/(d||1);null==N||null==(e=N.current)||e.style.setProperty("--marquee-duration",t+"s")}}),[v,d,null==c?void 0:c.spaceBetweenItems,h]),(0,a.useEffect)((()=>{N.current&&(o||N.current.style.setProperty("--marquee-animation-state","running"),I("ltr"===p?"right":"left"),T(!0),q.current=null==N?void 0:N.current.offsetWidth)}),[o,p]),(0,a.useEffect)((()=>{if(q&&h){const e=Math.ceil(q.current/h);g(e)}}),[h,q]);const _=u||(s?"h"+s:"p"),j=(0,a.useCallback)((()=>{if(null!=N&&N.current&&!o&&C){const e="paused"===C?"running":"paused";N.current.style.setProperty("--marquee-clicked",e),w(e)}}),[o,C]),B={...e,multiplicationFactor:v,width:h,setWidth:E,setAnimationState:w,dataMarqueeAnimation:k,animationApplied:P};return i().createElement("div",{id:r,onClick:j,className:l(S,y(x.root,...f)),ref:N},i().createElement(_,{className:L,"data-testid":D},null!=n&&n.resolvedLink?i().createElement(b,t()({className:M},n.resolvedLink),i().createElement(V,B)):i().createElement(V,B),i().createElement(W,{isPlaying:"running"===C,onToggle:j,translations:m,className:l(A,O)})))}}}}(),n}()})); //# sourceMappingURL=https://static.parastorage.com/services/editor-elements-library/dist/thunderbolt/rb_wixui.thunderbolt[TextMarquee].bc582c42.bundle.min.js.map